-- Artys
Arty_Khaimah_01 = nil

-- Fujairah 富查伊拉
REDBASE_Fujairah = SPAWN:New("RED BASE-1")
BLUEBASE_Fujairah = SPAWN:New("BLUE BASE-1")
Fujairah_ATTK = SPAWN:New("REDFujairah Attk"):InitLimit(7, 0):SpawnScheduled(300, 0.3)
    :OnSpawnGroup(function(group)
        SOUND_HOSTILEDETECTED:ToAll()
        MESSAGE:New("检测到敌方集结了一个装甲部队，正在向富查伊拉机场挺进", 10, "战局通报",
            false):ToAll()
    end)
Fujairah_ATTK:SpawnScheduleStop()
-- Fujairah 富查伊拉 END

-- Khaimah 哈伊马角
REDBASE_Khaimah = SPAWN:New("RED BASE-2")
BLUEBASE_Khaimah = SPAWN:New("BLUE BASE-2")

Khaimah_ATTK_01 = SPAWN:New("REDKhaimah Attk-1"):InitLimit(6, 0):SpawnScheduled(300, 0.3)
    :OnSpawnGroup(function(group)
        SOUND_HOSTILEDETECTED:ToAll()
        MESSAGE:New("检测到敌方在北方集结了一个装甲部队，正在向哈伊马角机场挺进", 10, "战局通报",
            false):ToAll()
    end)
Khaimah_ATTK_01:SpawnScheduleStop()

Khaimah_Arty_01 = SPAWN:New("REDKhaimah Arty-1"):InitLimit(4, 0):SpawnScheduled(300, 0.3)
    :OnSpawnGroup(function(group)
        Arty_Khaimah_01 = ARTY:New(group, "Khaimah North")
        MESSAGE:New("检测到敌方在哈伊马角北方有火箭炮在活动，请前出进行侦察并予以摧毁",
            10, "战局通报", false):ToAll()
        if BLUEBASE_Khaimah:GetFirstAliveGroup() ~= nil then -- 检测蓝方基地是否存在，以及红方火炮是否存活
            if GROUP:FindByName("Arty Rearming-1") then
                Arty_Khaimah_01:SetRearmingGroup(GROUP:FindByName("Arty Rearming-1"))
            end
            
            Arty_Khaimah_01:AssignTargetCoord(ZONE:FindByName("ArtyZoneKhaimah"):GetCoordinate(71), 10, 1000, 160, 100, nil, ARTY.WeaponType.Rockets, "Target Khaimah", false)
            Arty_Khaimah_01:SetReportOFF()
            Arty_Khaimah_01:SetDebugOFF()
            Arty_Khaimah_01:Start()
        end
        SOUND_INTEL:ToAll()
    end)
Khaimah_Arty_01:SpawnScheduleStop()
-- Khaimah 哈伊马角 END

-- Bandit
RED_MiG21_Khaimah = SPAWN:New("RED Bandit-1"):InitRepeat():InitLimit(2, 0):SpawnScheduled(800, 0.3)
RED_MiG21_Khaimah:SpawnScheduleStart()
RED_Tu160_Dubai = SPAWN:New("RED Tu160"):InitRepeat():InitLimit(2, 0):SpawnScheduled(600, 0.3)
RED_Tu160_Dubai:SpawnScheduleStart()

-- Friendly
BLUE_AEW = SPAWN:New("BLUE AEW-1"):InitRepeat():InitLimit(1, 0):SpawnScheduled(600, 0.3):SpawnScheduleStart()
BLUE_KC135 = SPAWN:New("BLUE KC135"):InitRepeat():InitLimit(1, 0):SpawnScheduled(600, 0.3):SpawnScheduleStart()
BLUE_KC135MPRS = SPAWN:New("BLUE KC135MPRS"):InitRepeat():InitLimit(1, 0):SpawnScheduled(600, 0.3):SpawnScheduleStart()

-- Support
AI_Su34SEAD = SPAWN:New("AI SEAD")